package com.liang.maogouyuyin.ui.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.liang.maogouyuyin.ui.fragment.AnimalFragment
import com.liang.maogouyuyin.ui.fragment.TrainingFragment
import com.liang.maogouyuyin.ui.fragment.VarietyFragment

class PetMenuFragmentAdapter(fragmentActivity: FragmentActivity): FragmentStateAdapter(fragmentActivity) {
    override fun getItemCount(): Int {
        return 3
    }

    override fun createFragment(position: Int): Fragment {
        return when(position) {
            0 -> VarietyFragment()
            1 -> TrainingFragment()
            2 -> AnimalFragment()
            else -> throw IllegalArgumentException()
        }
    }
}